package com.example.computertms.servers.impl;

import com.example.computertms.mapper.UserMapper;
import com.example.computertms.pojo.Users;
import com.example.computertms.servers.UserServers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class UserServersImpl implements UserServers {

    @Autowired
    private UserMapper userMapper;

    @Override
    @Transactional
    public Users findUserByAccount(String account) {
        return userMapper.findUserByAccount(account);
    }

    @Override
    @Transactional
    public void addUser(Users users) {
        userMapper.addUser(users.getOpenid(),users.getAccount(),users.getPassword(),users.getUserInfo());
    }

    @Override
    @Transactional
    public void changePassword(String password, String account) {
        userMapper.changePassword(password,account);
    }
}
